
mod generics;
mod traits;
mod pair;

use traits::Summary; // NOTE: 这里需要引用trait，否则下面NewArticle无法识别方法.

fn main() {
    println!("Hello, generic & trait!");

    generics::test();

    traits::test();
    let article = traits::NewArticle {
        headline: String::from("2022年"),
        location: String::from("Shanghai"),
        author: String::from("Melody"),
        content: String::from("2022年是虎年，是我的本命年。"),
    };
    println!("新稿子：{}", article.summarize());
    
    pair::test();
}
